Load Data

dataset <- read.delim("raw_data/FigureS1G.txt", stringsAsFactors = FALSE)

dataset$genotype <-  factor(dataset$genotype, levels = unique(dataset$genotype))
dataset$Experiment <- factor(rep(paste0("exp", 1:(length(dataset$genotype)/length(levels(dataset$genotype)))), each=length(levels(dataset$genotype))))

# genotype+Experiment gives unique ID (UID)
dataset$UID <- factor(paste(dataset$Experiment, dataset$genotype))


# wide format
kable(dataset, row.names = F)
genotype NT niraparib_30nM niraparib_300nM niraparib_3000nM Experiment UID
WT 875.0 827.0 706.0 10.0 exp1 exp1 WT
PARP1KO 763.0 751.0 784.5 593.5 exp1 exp1 PARP1KO
ALC1KO 726.0 412.0 202.5 0.0 exp1 exp1 ALC1KO
ALC1KO PARP1KO 458.5 458.0 391.5 148.5 exp1 exp1 ALC1KO PARP1KO
WT 632.0 697.0 616.0 155.5 exp2 exp2 WT
PARP1KO 892.0 965.0 859.0 930.0 exp2 exp2 PARP1KO
ALC1KO 982.0 1033.0 629.0 2.0 exp2 exp2 ALC1KO
ALC1KO PARP1KO 720.0 753.5 716.0 560.5 exp2 exp2 ALC1KO PARP1KO
WT 645.5 686.0 676.0 140.0 exp3 exp3 WT
PARP1KO 923.0 948.5 901.5 943.5 exp3 exp3 PARP1KO
ALC1KO 963.0 1064.0 580.5 4.5 exp3 exp3 ALC1KO
ALC1KO PARP1KO 744.0 792.5 686.0 585.5 exp3 exp3 ALC1KO PARP1KO
WT 953.0 970.0 924.0 50.0 exp4 exp4 WT
PARP1KO 783.0 818.5 831.5 740.5 exp4 exp4 PARP1KO
ALC1KO 850.0 689.0 208.5 1.0 exp4 exp4 ALC1KO
ALC1KO PARP1KO 950.0 889.0 786.5 623.0 exp4 exp4 ALC1KO PARP1KO
WT 789.5 825.5 806.0 84.0 exp5 exp5 WT
PARP1KO 802.5 787.0 821.5 752.0 exp5 exp5 PARP1KO
ALC1KO 927.0 750.0 179.5 0.5 exp5 exp5 ALC1KO
ALC1KO PARP1KO 969.5 947.5 922.5 661.5 exp5 exp5 ALC1KO PARP1KO
library(reshape2)
# reshape to long format
dataset <- melt(dataset, variable.name = "Treatment", value.name = "Counts")

dataset$genotype <- relevel(dataset$genotype, ref = "WT")
dataset$UID <- relevel(dataset$UID, ref = "exp1 WT")

dataset$Niraparib <- gsub("NT","1",dataset$Treatment)
dataset$Niraparib <- gsub("niraparib_|nM","",dataset$Niraparib)
dataset$Niraparib <- log10(as.integer(dataset$Niraparib))


dataset$Offset <- NA
for(uid in levels(dataset$UID)){
        dataset$Offset[dataset$UID == uid] <- mean(dataset$Counts[dataset$UID == uid])
}

dataset$NormCounts <- dataset$Counts / dataset$Offset



dataset$Offset2 <- NA
for(gidx in levels(dataset$genotype)){
        dataset$Offset2[dataset$genotype == gidx] <- mean(dataset$NormCounts[dataset$genotype == gidx & dataset$Niraparib == 0])
}

dataset$NormCounts2 <- dataset$NormCounts / dataset$Offset2



# long format
kable(dataset, row.names = F)
genotype Experiment UID Treatment Counts Niraparib Offset NormCounts Offset2 NormCounts2
WT exp1 exp1 WT NT 875.0 0.000000 604.500 1.4474773 1.285970 1.1255916
PARP1KO exp1 exp1 PARP1KO NT 763.0 0.000000 723.000 1.0553250 1.005824 1.0492140
ALC1KO exp1 exp1 ALC1KO NT 726.0 0.000000 335.125 2.1663558 1.813377 1.1946527
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO NT 458.5 0.000000 364.125 1.2591830 1.128748 1.1155574
WT exp2 exp2 WT NT 632.0 0.000000 525.125 1.2035230 1.285970 0.9358871
PARP1KO exp2 exp2 PARP1KO NT 892.0 0.000000 911.500 0.9786067 1.005824 0.9729399
ALC1KO exp2 exp2 ALC1KO NT 982.0 0.000000 661.500 1.4845049 1.813377 0.8186410
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO NT 720.0 0.000000 687.500 1.0472727 1.128748 0.9278182
WT exp3 exp3 WT NT 645.5 0.000000 536.875 1.2023283 1.285970 0.9349581
PARP1KO exp3 exp3 PARP1KO NT 923.0 0.000000 929.125 0.9934078 1.005824 0.9876553
ALC1KO exp3 exp3 ALC1KO NT 963.0 0.000000 653.000 1.4747320 1.813377 0.8132517
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO NT 744.0 0.000000 702.000 1.0598291 1.128748 0.9389423
WT exp4 exp4 WT NT 953.0 0.000000 724.250 1.3158440 1.285970 1.0232305
PARP1KO exp4 exp4 PARP1KO NT 783.0 0.000000 793.375 0.9869230 1.005824 0.9812081
ALC1KO exp4 exp4 ALC1KO NT 850.0 0.000000 437.125 1.9445239 1.813377 1.0723218
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO NT 950.0 0.000000 812.125 1.1697707 1.128748 1.0363437
WT exp5 exp5 WT NT 789.5 0.000000 626.250 1.2606786 1.285970 0.9803327
PARP1KO exp5 exp5 PARP1KO NT 802.5 0.000000 790.750 1.0148593 1.005824 1.0089826
ALC1KO exp5 exp5 ALC1KO NT 927.0 0.000000 464.250 1.9967690 1.813377 1.1011328
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO NT 969.5 0.000000 875.250 1.1076835 1.128748 0.9813384
WT exp1 exp1 WT niraparib_30nM 827.0 1.477121 604.500 1.3680728 1.285970 1.0638448
PARP1KO exp1 exp1 PARP1KO niraparib_30nM 751.0 1.477121 723.000 1.0387275 1.005824 1.0327126
ALC1KO exp1 exp1 ALC1KO niraparib_30nM 412.0 1.477121 335.125 1.2293920 1.813377 0.6779572
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO niraparib_30nM 458.0 1.477121 364.125 1.2578098 1.128748 1.1143409
WT exp2 exp2 WT niraparib_30nM 697.0 1.477121 525.125 1.3273030 1.285970 1.0321413
PARP1KO exp2 exp2 PARP1KO niraparib_30nM 965.0 1.477121 911.500 1.0586945 1.005824 1.0525640
ALC1KO exp2 exp2 ALC1KO niraparib_30nM 1033.0 1.477121 661.500 1.5616024 1.813377 0.8611570
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO niraparib_30nM 753.5 1.477121 687.500 1.0960000 1.128748 0.9709875
WT exp3 exp3 WT niraparib_30nM 686.0 1.477121 536.875 1.2777648 1.285970 0.9936193
PARP1KO exp3 exp3 PARP1KO niraparib_30nM 948.5 1.477121 929.125 1.0208530 1.005824 1.0149416
ALC1KO exp3 exp3 ALC1KO niraparib_30nM 1064.0 1.477121 653.000 1.6294028 1.813377 0.8985460
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO niraparib_30nM 792.5 1.477121 702.000 1.1289174 1.128748 1.0001502
WT exp4 exp4 WT niraparib_30nM 970.0 1.477121 724.250 1.3393165 1.285970 1.0414833
PARP1KO exp4 exp4 PARP1KO niraparib_30nM 818.5 1.477121 793.375 1.0316685 1.005824 1.0256945
ALC1KO exp4 exp4 ALC1KO niraparib_30nM 689.0 1.477121 437.125 1.5762082 1.813377 0.8692115
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO niraparib_30nM 889.0 1.477121 812.125 1.0946591 1.128748 0.9697995
WT exp5 exp5 WT niraparib_30nM 825.5 1.477121 626.250 1.3181637 1.285970 1.0250344
PARP1KO exp5 exp5 PARP1KO niraparib_30nM 787.0 1.477121 790.750 0.9952577 1.005824 0.9894945
ALC1KO exp5 exp5 ALC1KO niraparib_30nM 750.0 1.477121 464.250 1.6155089 1.813377 0.8908841
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO niraparib_30nM 947.5 1.477121 875.250 1.0825478 1.128748 0.9590697
WT exp1 exp1 WT niraparib_300nM 706.0 2.477121 604.500 1.1679074 1.285970 0.9081916
PARP1KO exp1 exp1 PARP1KO niraparib_300nM 784.5 2.477121 723.000 1.0850622 1.005824 1.0787790
ALC1KO exp1 exp1 ALC1KO niraparib_300nM 202.5 2.477121 335.125 0.6042521 1.813377 0.3332192
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO niraparib_300nM 391.5 2.477121 364.125 1.0751802 1.128748 0.9525425
WT exp2 exp2 WT niraparib_300nM 616.0 2.477121 525.125 1.1730540 1.285970 0.9121938
PARP1KO exp2 exp2 PARP1KO niraparib_300nM 859.0 2.477121 911.500 0.9424026 1.005824 0.9369455
ALC1KO exp2 exp2 ALC1KO niraparib_300nM 629.0 2.477121 661.500 0.9508692 1.813377 0.5243638
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO niraparib_300nM 716.0 2.477121 687.500 1.0414545 1.128748 0.9226636
WT exp3 exp3 WT niraparib_300nM 676.0 2.477121 536.875 1.2591385 1.285970 0.9791351
PARP1KO exp3 exp3 PARP1KO niraparib_300nM 901.5 2.477121 929.125 0.9702677 1.005824 0.9646493
ALC1KO exp3 exp3 ALC1KO niraparib_300nM 580.5 2.477121 653.000 0.8889740 1.813377 0.4902312
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO niraparib_300nM 686.0 2.477121 702.000 0.9772080 1.128748 0.8657452
WT exp4 exp4 WT niraparib_300nM 924.0 2.477121 724.250 1.2758026 1.285970 0.9920934
PARP1KO exp4 exp4 PARP1KO niraparib_300nM 831.5 2.477121 793.375 1.0480542 1.005824 1.0419853
ALC1KO exp4 exp4 ALC1KO niraparib_300nM 208.5 2.477121 437.125 0.4769803 1.813377 0.2630342
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO niraparib_300nM 786.5 2.477121 812.125 0.9684470 1.128748 0.8579835
WT exp5 exp5 WT niraparib_300nM 806.0 2.477121 626.250 1.2870259 1.285970 1.0008210
PARP1KO exp5 exp5 PARP1KO niraparib_300nM 821.5 2.477121 790.750 1.0388871 1.005824 1.0328713
ALC1KO exp5 exp5 ALC1KO niraparib_300nM 179.5 2.477121 464.250 0.3866451 1.813377 0.2132183
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO niraparib_300nM 922.5 2.477121 875.250 1.0539846 1.128748 0.9337645
WT exp1 exp1 WT niraparib_3000nM 10.0 3.477121 604.500 0.0165426 1.285970 0.0128639
PARP1KO exp1 exp1 PARP1KO niraparib_3000nM 593.5 3.477121 723.000 0.8208852 1.005824 0.8161318
ALC1KO exp1 exp1 ALC1KO niraparib_3000nM 0.0 3.477121 335.125 0.0000000 1.813377 0.0000000
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO niraparib_3000nM 148.5 3.477121 364.125 0.4078270 1.128748 0.3613092
WT exp2 exp2 WT niraparib_3000nM 155.5 3.477121 525.125 0.2961200 1.285970 0.2302697
PARP1KO exp2 exp2 PARP1KO niraparib_3000nM 930.0 3.477121 911.500 1.0202962 1.005824 1.0143881
ALC1KO exp2 exp2 ALC1KO niraparib_3000nM 2.0 3.477121 661.500 0.0030234 1.813377 0.0016673
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO niraparib_3000nM 560.5 3.477121 687.500 0.8152727 1.128748 0.7222807
WT exp3 exp3 WT niraparib_3000nM 140.0 3.477121 536.875 0.2607683 1.285970 0.2027795
PARP1KO exp3 exp3 PARP1KO niraparib_3000nM 943.5 3.477121 929.125 1.0154715 1.005824 1.0095913
ALC1KO exp3 exp3 ALC1KO niraparib_3000nM 4.5 3.477121 653.000 0.0068913 1.813377 0.0038002
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO niraparib_3000nM 585.5 3.477121 702.000 0.8340456 1.128748 0.7389123
WT exp4 exp4 WT niraparib_3000nM 50.0 3.477121 724.250 0.0690369 1.285970 0.0536847
PARP1KO exp4 exp4 PARP1KO niraparib_3000nM 740.5 3.477121 793.375 0.9333543 1.005824 0.9279496
ALC1KO exp4 exp4 ALC1KO niraparib_3000nM 1.0 3.477121 437.125 0.0022877 1.813377 0.0012616
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO niraparib_3000nM 623.0 3.477121 812.125 0.7671233 1.128748 0.6796233
WT exp5 exp5 WT niraparib_3000nM 84.0 3.477121 626.250 0.1341317 1.285970 0.1043039
PARP1KO exp5 exp5 PARP1KO niraparib_3000nM 752.0 3.477121 790.750 0.9509959 1.005824 0.9454890
ALC1KO exp5 exp5 ALC1KO niraparib_3000nM 0.5 3.477121 464.250 0.0010770 1.813377 0.0005939
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO niraparib_3000nM 661.5 3.477121 875.250 0.7557841 1.128748 0.6695774

Plot Data

library(ggplot2)

# raw data
ggplot(dataset, aes(x=Niraparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=FALSE, colour="#666666") +
        geom_point(aes(colour=Treatment, shape=Experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") +
        scale_shape_manual(values=14:19) +
        scale_color_manual(values=c("#999999","#0072B2","#CC79A7","#009E73"))

# Counts Linear
ggplot(dataset, aes(x=Niraparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)")

# NormCounts Linear
ggplot(dataset, aes(x=Niraparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)")

# NormCounts2 Linear
ggplot(dataset, aes(x=Niraparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)")

# Counts Quadratic
ggplot(dataset, aes(x=Niraparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

# NormCounts Quadratic
ggplot(dataset, aes(x=Niraparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

# NormCounts2 Quadratic
ggplot(dataset, aes(x=Niraparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

# Counts Cubic
ggplot(dataset, aes(x=Niraparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

# NormCounts Cubic
ggplot(dataset, aes(x=Niraparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

# NormCounts2 Cubic
ggplot(dataset, aes(x=Niraparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") 

library(Cairo)

cairo_pdf("FigureS1G_v1.pdf", width = 14, height = 4, family = "Arial")

ggplot(dataset, aes(x=Niraparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#800000','#000080','#808080'))

dev.off()
## quartz_off_screen 
##                 2
cairo_pdf("FigureS1G_v2.pdf", width = 6, height = 4, family = "Arial")

ggplot(dataset, aes(x=Niraparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        #facet_grid(. ~ genotype) +
        xlab(label = "Niraparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#800000','#000080','#808080'))

dev.off()
## quartz_off_screen 
##                 2

Models

library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)

Linear formula

fit1 <- lm(Counts ~ Experiment + Niraparib*genotype, data = dataset)
print(summary(fit1))
## 
## Call:
## lm(formula = Counts ~ Experiment + Niraparib * genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -333.07 -108.64   -7.35   94.55  406.75 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        775.35      80.94   9.580 3.06e-14 ***
## Experimentexp2                     189.72      63.27   2.999 0.003786 ** 
## Experimentexp3                     198.56      63.27   3.138 0.002512 ** 
## Experimentexp4                     185.03      63.27   2.925 0.004683 ** 
## Experimentexp5                     182.44      63.27   2.884 0.005261 ** 
## Niraparib                         -173.91      31.15  -5.584 4.47e-07 ***
## genotypePARP1KO                    -77.28      99.49  -0.777 0.440013    
## genotypeALC1KO                      69.91      99.49   0.703 0.484663    
## genotypeALC1KO PARP1KO            -111.40      99.49  -1.120 0.266803    
## Niraparib:genotypePARP1KO          163.32      44.05   3.708 0.000422 ***
## Niraparib:genotypeALC1KO           -87.80      44.05  -1.993 0.050253 .  
## Niraparib:genotypeALC1KO PARP1KO   105.61      44.05   2.398 0.019258 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179 on 68 degrees of freedom
## Multiple R-squared:  0.6958, Adjusted R-squared:  0.6465 
## F-statistic: 14.14 on 11 and 68 DF,  p-value: 1.172e-13
cat("AIC: ", AIC(fit1))
## AIC:  1069.966
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(NormCounts ~ Niraparib*genotype, data = dataset)
print(summary(fit2))
## 
## Call:
## lm(formula = NormCounts ~ Niraparib * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.52255 -0.13024  0.00821  0.11352  0.46329 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.52881    0.09432  16.209  < 2e-16 ***
## Niraparib                        -0.28463    0.04176  -6.816 2.41e-09 ***
## genotypePARP1KO                  -0.50200    0.13339  -3.763 0.000339 ***
## genotypeALC1KO                    0.46584    0.13339   3.492 0.000822 ***
## genotypeALC1KO PARP1KO           -0.32200    0.13339  -2.414 0.018321 *  
## Niraparib:genotypePARP1KO         0.27021    0.05905   4.576 1.93e-05 ***
## Niraparib:genotypeALC1KO         -0.25074    0.05905  -4.246 6.40e-05 ***
## Niraparib:genotypeALC1KO PARP1KO  0.17332    0.05905   2.935 0.004473 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2399 on 72 degrees of freedom
## Multiple R-squared:  0.7518, Adjusted R-squared:  0.7277 
## F-statistic: 31.15 on 7 and 72 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit2))
## AIC:  8.204839
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(NormCounts2 ~ Niraparib*genotype, data = dataset)
print(summary(fit3))
## 
## Call:
## lm(formula = NormCounts2 ~ Niraparib * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.40635 -0.07229  0.00692  0.09547  0.36027 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.18883    0.06772  17.555  < 2e-16 ***
## Niraparib                        -0.22134    0.02998  -7.383 2.17e-10 ***
## genotypePARP1KO                  -0.16797    0.09577  -1.754  0.08371 .  
## genotypeALC1KO                   -0.08887    0.09577  -0.928  0.35651    
## genotypeALC1KO PARP1KO           -0.11968    0.09577  -1.250  0.21546    
## Niraparib:genotypePARP1KO         0.20699    0.04240   4.882 6.12e-06 ***
## Niraparib:genotypeALC1KO         -0.07390    0.04240  -1.743  0.08562 .  
## Niraparib:genotypeALC1KO PARP1KO  0.12272    0.04240   2.894  0.00502 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1723 on 72 degrees of freedom
## Multiple R-squared:  0.7654, Adjusted R-squared:  0.7426 
## F-statistic: 33.55 on 7 and 72 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC:  -44.80283
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

fit4 <- lmer(Counts ~ Niraparib*genotype + (1|UID), data = dataset)
print(summary(fit4))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ Niraparib * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 979.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.16273 -0.53814 -0.09473  0.43116  2.24089 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 11807    108.7   
##  Residual             26129    161.6   
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                  Estimate Std. Error      df t value Pr(>|t|)
## (Intercept)                        926.50      80.00   42.05  11.581 1.15e-14
## Niraparib                         -173.91      28.13   56.00  -6.182 7.69e-08
## genotypePARP1KO                    -77.28     113.14   42.05  -0.683 0.498309
## genotypeALC1KO                      69.91     113.14   42.05   0.618 0.539949
## genotypeALC1KO PARP1KO            -111.40     113.14   42.05  -0.985 0.330433
## Niraparib:genotypePARP1KO          163.32      39.79   56.00   4.105 0.000133
## Niraparib:genotypeALC1KO           -87.80      39.79   56.00  -2.207 0.031459
## Niraparib:genotypeALC1KO PARP1KO   105.61      39.79   56.00   2.654 0.010329
##                                     
## (Intercept)                      ***
## Niraparib                        ***
## genotypePARP1KO                     
## genotypeALC1KO                      
## genotypeALC1KO PARP1KO              
## Niraparib:genotypePARP1KO        ***
## Niraparib:genotypeALC1KO         *  
## Niraparib:genotypeALC1KO PARP1KO *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Nirprb gPARP1 gALC1K gALC1P N:PARP N:ALC1
## Niraparib   -0.653                                          
## gntyPARP1KO -0.707  0.462                                   
## gntypALC1KO -0.707  0.462  0.500                            
## gALC1KOPARP -0.707  0.462  0.500  0.500                     
## Nrp:PARP1KO  0.462 -0.707 -0.653 -0.327 -0.327              
## Nrpr:ALC1KO  0.462 -0.707 -0.327 -0.653 -0.327  0.500       
## N:ALC1KOPAR  0.462 -0.707 -0.327 -0.327 -0.653  0.500  0.500
cat("AIC: ", AIC(fit4))
## AIC:  999.1114
simres <- simulateResiduals(fittedModel = fit4)
plot(simres)

Quadratic formula

fit5 <- lm(Counts ~ Experiment + poly(Niraparib, 2)*genotype, data = dataset)
print(summary(fit5))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Niraparib, 2) * genotype, 
##     data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -281.09  -73.08  -10.46   78.20  285.10 
## 
## Coefficients:
##                                            Estimate Std. Error t value Pr(>|t|)
## (Intercept)                                  452.25      43.70  10.349 2.68e-15
## Experimentexp2                               189.72      48.86   3.883 0.000247
## Experimentexp3                               198.56      48.86   4.064 0.000134
## Experimentexp4                               185.03      48.86   3.787 0.000339
## Experimentexp5                               182.44      48.86   3.734 0.000403
## poly(Niraparib, 2)1                        -1998.41     276.38  -7.231 7.31e-10
## poly(Niraparib, 2)2                        -1649.24     276.38  -5.967 1.15e-07
## genotypePARP1KO                              226.15      43.70   5.175 2.45e-06
## genotypeALC1KO                               -93.20      43.70  -2.133 0.036785
## genotypeALC1KO PARP1KO                        84.80      43.70   1.941 0.056721
## poly(Niraparib, 2)1:genotypePARP1KO         1876.75     390.86   4.802 9.85e-06
## poly(Niraparib, 2)2:genotypePARP1KO         1483.15     390.86   3.795 0.000331
## poly(Niraparib, 2)1:genotypeALC1KO         -1008.86     390.86  -2.581 0.012149
## poly(Niraparib, 2)2:genotypeALC1KO           731.76     390.86   1.872 0.065750
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO  1213.51     390.86   3.105 0.002836
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO  1167.20     390.86   2.986 0.003999
##                                               
## (Intercept)                                ***
## Experimentexp2                             ***
## Experimentexp3                             ***
## Experimentexp4                             ***
## Experimentexp5                             ***
## poly(Niraparib, 2)1                        ***
## poly(Niraparib, 2)2                        ***
## genotypePARP1KO                            ***
## genotypeALC1KO                             *  
## genotypeALC1KO PARP1KO                     .  
## poly(Niraparib, 2)1:genotypePARP1KO        ***
## poly(Niraparib, 2)2:genotypePARP1KO        ***
## poly(Niraparib, 2)1:genotypeALC1KO         *  
## poly(Niraparib, 2)2:genotypeALC1KO         .  
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO ** 
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 138.2 on 64 degrees of freedom
## Multiple R-squared:  0.8292, Adjusted R-squared:  0.7892 
## F-statistic: 20.72 on 15 and 64 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit5))
## AIC:  1031.758
simres <- simulateResiduals(fittedModel = fit5)
plot(simres)

fit6 <- lm(NormCounts ~ poly(Niraparib, 2)*genotype, data = dataset)
print(summary(fit6))
## 
## Call:
## lm(formula = NormCounts ~ poly(Niraparib, 2) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.41564 -0.05728  0.01725  0.07613  0.32558 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.000e+00  3.387e-02  29.528
## poly(Niraparib, 2)1                        -3.271e+00  3.029e-01 -10.798
## poly(Niraparib, 2)2                        -2.711e+00  3.029e-01  -8.950
## genotypePARP1KO                             8.887e-16  4.789e-02   0.000
## genotypeALC1KO                              6.802e-16  4.789e-02   0.000
## genotypeALC1KO PARP1KO                      8.668e-16  4.789e-02   0.000
## poly(Niraparib, 2)1:genotypePARP1KO         3.105e+00  4.284e-01   7.248
## poly(Niraparib, 2)2:genotypePARP1KO         2.492e+00  4.284e-01   5.818
## poly(Niraparib, 2)1:genotypeALC1KO         -2.881e+00  4.284e-01  -6.726
## poly(Niraparib, 2)2:genotypeALC1KO          1.198e+00  4.284e-01   2.797
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO  1.992e+00  4.284e-01   4.649
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO  1.904e+00  4.284e-01   4.444
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Niraparib, 2)1                         < 2e-16 ***
## poly(Niraparib, 2)2                        4.16e-13 ***
## genotypePARP1KO                              1.0000    
## genotypeALC1KO                               1.0000    
## genotypeALC1KO PARP1KO                       1.0000    
## poly(Niraparib, 2)1:genotypePARP1KO        5.06e-10 ***
## poly(Niraparib, 2)2:genotypePARP1KO        1.77e-07 ***
## poly(Niraparib, 2)1:genotypeALC1KO         4.41e-09 ***
## poly(Niraparib, 2)2:genotypeALC1KO           0.0067 ** 
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO 1.58e-05 ***
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO 3.34e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1515 on 68 degrees of freedom
## Multiple R-squared:  0.9066, Adjusted R-squared:  0.8915 
## F-statistic: 59.99 on 11 and 68 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit6))
## AIC:  -61.96441
simres <- simulateResiduals(fittedModel = fit6)
plot(simres)

fit7 <- lm(NormCounts2 ~ poly(Niraparib, 2)*genotype, data = dataset)
print(summary(fit7))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Niraparib, 2) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.27959 -0.05075  0.01715  0.06445  0.17954 
## 
## Coefficients:
##                                            Estimate Std. Error t value Pr(>|t|)
## (Intercept)                                 0.77762    0.02288  33.994  < 2e-16
## poly(Niraparib, 2)1                        -2.54339    0.20460 -12.431  < 2e-16
## poly(Niraparib, 2)2                        -2.10815    0.20460 -10.304 1.59e-15
## genotypePARP1KO                             0.21659    0.03235   6.695 5.00e-09
## genotypeALC1KO                             -0.22617    0.03235  -6.991 1.47e-09
## genotypeALC1KO PARP1KO                      0.10831    0.03235   3.348  0.00133
## poly(Niraparib, 2)1:genotypePARP1KO         2.37854    0.28935   8.220 8.73e-12
## poly(Niraparib, 2)2:genotypePARP1KO         1.89063    0.28935   6.534 9.70e-09
## poly(Niraparib, 2)1:genotypeALC1KO         -0.84916    0.28935  -2.935  0.00455
## poly(Niraparib, 2)2:genotypeALC1KO          1.27394    0.28935   4.403 3.87e-05
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO  1.41019    0.28935   4.874 6.88e-06
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO  1.39304    0.28935   4.814 8.59e-06
##                                               
## (Intercept)                                ***
## poly(Niraparib, 2)1                        ***
## poly(Niraparib, 2)2                        ***
## genotypePARP1KO                            ***
## genotypeALC1KO                             ***
## genotypeALC1KO PARP1KO                     ** 
## poly(Niraparib, 2)1:genotypePARP1KO        ***
## poly(Niraparib, 2)2:genotypePARP1KO        ***
## poly(Niraparib, 2)1:genotypeALC1KO         ** 
## poly(Niraparib, 2)2:genotypeALC1KO         ***
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO ***
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1023 on 68 degrees of freedom
## Multiple R-squared:  0.9218, Adjusted R-squared:  0.9092 
## F-statistic: 72.92 on 11 and 68 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit7))
## AIC:  -124.7442
simres <- simulateResiduals(fittedModel = fit7)
plot(simres)

fit8 <- lmer(Counts ~ poly(Niraparib, 2)*genotype + (1|UID), data = dataset)
print(summary(fit8))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Niraparib, 2) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 850.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.12477 -0.47088 -0.01049  0.55348  2.11212 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 15898    126.09  
##  Residual              9765     98.82  
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                            Estimate Std. Error       df t value
## (Intercept)                                  603.40      60.56    16.00   9.963
## poly(Niraparib, 2)1                        -1998.41     197.64    52.00 -10.112
## poly(Niraparib, 2)2                        -1649.24     197.64    52.00  -8.345
## genotypePARP1KO                              226.15      85.65    16.00   2.640
## genotypeALC1KO                               -93.20      85.65    16.00  -1.088
## genotypeALC1KO PARP1KO                        84.80      85.65    16.00   0.990
## poly(Niraparib, 2)1:genotypePARP1KO         1876.75     279.50    52.00   6.715
## poly(Niraparib, 2)2:genotypePARP1KO         1483.15     279.50    52.00   5.306
## poly(Niraparib, 2)1:genotypeALC1KO         -1008.86     279.50    52.00  -3.609
## poly(Niraparib, 2)2:genotypeALC1KO           731.76     279.50    52.00   2.618
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO  1213.51     279.50    52.00   4.342
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO  1167.20     279.50    52.00   4.176
##                                            Pr(>|t|)    
## (Intercept)                                2.89e-08 ***
## poly(Niraparib, 2)1                        7.08e-14 ***
## poly(Niraparib, 2)2                        3.64e-11 ***
## genotypePARP1KO                            0.017813 *  
## genotypeALC1KO                             0.292640    
## genotypeALC1KO PARP1KO                     0.336865    
## poly(Niraparib, 2)1:genotypePARP1KO        1.41e-08 ***
## poly(Niraparib, 2)2:genotypePARP1KO        2.34e-06 ***
## poly(Niraparib, 2)1:genotypeALC1KO         0.000690 ***
## poly(Niraparib, 2)2:genotypeALC1KO         0.011556 *  
## poly(Niraparib, 2)1:genotypeALC1KO PARP1KO 6.56e-05 ***
## poly(Niraparib, 2)2:genotypeALC1KO PARP1KO 0.000113 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) pl(N,2)1 pl(N,2)2 gPARP1 gALC1K gALC1P p(N,2)1:P p(N,2)2:P
## ply(Nrp,2)1  0.000                                                           
## ply(Nrp,2)2  0.000  0.000                                                    
## gntyPARP1KO -0.707  0.000    0.000                                           
## gntypALC1KO -0.707  0.000    0.000    0.500                                  
## gALC1KOPARP -0.707  0.000    0.000    0.500  0.500                           
## p(N,2)1:PAR  0.000 -0.707    0.000    0.000  0.000  0.000                    
## p(N,2)2:PAR  0.000  0.000   -0.707    0.000  0.000  0.000  0.000             
## p(N,2)1:ALC  0.000 -0.707    0.000    0.000  0.000  0.000  0.500     0.000   
## p(N,2)2:ALC  0.000  0.000   -0.707    0.000  0.000  0.000  0.000     0.500   
## p(N,2)1:ALP  0.000 -0.707    0.000    0.000  0.000  0.000  0.500     0.000   
## p(N,2)2:ALP  0.000  0.000   -0.707    0.000  0.000  0.000  0.000     0.500   
##             p(N,2)1:A p(N,2)2:A p(N,2)1P
## ply(Nrp,2)1                             
## ply(Nrp,2)2                             
## gntyPARP1KO                             
## gntypALC1KO                             
## gALC1KOPARP                             
## p(N,2)1:PAR                             
## p(N,2)2:PAR                             
## p(N,2)1:ALC                             
## p(N,2)2:ALC  0.000                      
## p(N,2)1:ALP  0.500     0.000            
## p(N,2)2:ALP  0.000     0.500     0.000
cat("AIC: ", AIC(fit8))
## AIC:  878.8193
simres <- simulateResiduals(fittedModel = fit8)
plot(simres)

Cubic formula

fit9 <- lm(Counts ~ Experiment + poly(Niraparib, 3)*genotype, data = dataset)
print(summary(fit9))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Niraparib, 3) * genotype, 
##     data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -226.450  -71.789   -9.669   82.842  247.150 
## 
## Coefficients:
##                                            Estimate Std. Error t value Pr(>|t|)
## (Intercept)                                  452.25      42.33  10.685 1.64e-15
## Experimentexp2                               189.72      47.32   4.009 0.000171
## Experimentexp3                               198.56      47.32   4.196 9.11e-05
## Experimentexp4                               185.03      47.32   3.910 0.000238
## Experimentexp5                               182.44      47.32   3.855 0.000284
## poly(Niraparib, 3)1                        -1998.41     267.70  -7.465 4.02e-10
## poly(Niraparib, 3)2                        -1649.24     267.70  -6.161 6.61e-08
## poly(Niraparib, 3)3                         -635.60     267.70  -2.374 0.020798
## genotypePARP1KO                              226.15      42.33   5.343 1.49e-06
## genotypeALC1KO                               -93.20      42.33  -2.202 0.031527
## genotypeALC1KO PARP1KO                        84.80      42.33   2.003 0.049650
## poly(Niraparib, 3)1:genotypePARP1KO         1876.75     378.58   4.957 6.18e-06
## poly(Niraparib, 3)2:genotypePARP1KO         1483.15     378.58   3.918 0.000232
## poly(Niraparib, 3)3:genotypePARP1KO          623.91     378.58   1.648 0.104578
## poly(Niraparib, 3)1:genotypeALC1KO         -1008.86     378.58  -2.665 0.009880
## poly(Niraparib, 3)2:genotypeALC1KO           731.76     378.58   1.933 0.057972
## poly(Niraparib, 3)3:genotypeALC1KO          1059.16     378.58   2.798 0.006908
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO  1213.51     378.58   3.205 0.002162
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO  1167.20     378.58   3.083 0.003094
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO   562.54     378.58   1.486 0.142541
##                                               
## (Intercept)                                ***
## Experimentexp2                             ***
## Experimentexp3                             ***
## Experimentexp4                             ***
## Experimentexp5                             ***
## poly(Niraparib, 3)1                        ***
## poly(Niraparib, 3)2                        ***
## poly(Niraparib, 3)3                        *  
## genotypePARP1KO                            ***
## genotypeALC1KO                             *  
## genotypeALC1KO PARP1KO                     *  
## poly(Niraparib, 3)1:genotypePARP1KO        ***
## poly(Niraparib, 3)2:genotypePARP1KO        ***
## poly(Niraparib, 3)3:genotypePARP1KO           
## poly(Niraparib, 3)1:genotypeALC1KO         ** 
## poly(Niraparib, 3)2:genotypeALC1KO         .  
## poly(Niraparib, 3)3:genotypeALC1KO         ** 
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO ** 
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO ** 
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 133.8 on 60 degrees of freedom
## Multiple R-squared:  0.8498, Adjusted R-squared:  0.8023 
## F-statistic: 17.87 on 19 and 60 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit9))
## AIC:  1029.49
simres <- simulateResiduals(fittedModel = fit9)
plot(simres)

fit10 <- lm(NormCounts ~ poly(Niraparib, 3)*genotype, data = dataset)
print(summary(fit10))
## 
## Call:
## lm(formula = NormCounts ~ poly(Niraparib, 3) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.33865 -0.04709  0.00190  0.05132  0.35298 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.000e+00  2.936e-02  34.055
## poly(Niraparib, 3)1                        -3.271e+00  2.626e-01 -12.453
## poly(Niraparib, 3)2                        -2.711e+00  2.626e-01 -10.322
## poly(Niraparib, 3)3                        -1.033e+00  2.626e-01  -3.933
## genotypePARP1KO                             1.610e-15  4.153e-02   0.000
## genotypeALC1KO                              9.364e-16  4.153e-02   0.000
## genotypeALC1KO PARP1KO                      1.237e-15  4.153e-02   0.000
## poly(Niraparib, 3)1:genotypePARP1KO         3.105e+00  3.714e-01   8.359
## poly(Niraparib, 3)2:genotypePARP1KO         2.492e+00  3.714e-01   6.710
## poly(Niraparib, 3)3:genotypePARP1KO         9.932e-01  3.714e-01   2.674
## poly(Niraparib, 3)1:genotypeALC1KO         -2.881e+00  3.714e-01  -7.757
## poly(Niraparib, 3)2:genotypeALC1KO          1.198e+00  3.714e-01   3.226
## poly(Niraparib, 3)3:genotypeALC1KO          1.893e+00  3.714e-01   5.097
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO  1.992e+00  3.714e-01   5.362
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO  1.904e+00  3.714e-01   5.126
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO  9.060e-01  3.714e-01   2.439
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Niraparib, 3)1                         < 2e-16 ***
## poly(Niraparib, 3)2                        2.98e-15 ***
## poly(Niraparib, 3)3                        0.000209 ***
## genotypePARP1KO                            1.000000    
## genotypeALC1KO                             1.000000    
## genotypeALC1KO PARP1KO                     1.000000    
## poly(Niraparib, 3)1:genotypePARP1KO        7.51e-12 ***
## poly(Niraparib, 3)2:genotypePARP1KO        5.99e-09 ***
## poly(Niraparib, 3)3:genotypePARP1KO        0.009503 ** 
## poly(Niraparib, 3)1:genotypeALC1KO         8.64e-11 ***
## poly(Niraparib, 3)2:genotypeALC1KO         0.001978 ** 
## poly(Niraparib, 3)3:genotypeALC1KO         3.29e-06 ***
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO 1.21e-06 ***
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO 2.95e-06 ***
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO 0.017500 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1313 on 64 degrees of freedom
## Multiple R-squared:  0.9339, Adjusted R-squared:  0.9184 
## F-statistic: 60.28 on 15 and 64 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit10))
## AIC:  -81.64107
simres <- simulateResiduals(fittedModel = fit10)
plot(simres)

fit11 <- lm(NormCounts2 ~ poly(Niraparib, 3)*genotype, data = dataset)
print(summary(fit11))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Niraparib, 3) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.273031 -0.038403  0.001626  0.043071  0.194653 
## 
## Coefficients:
##                                            Estimate Std. Error t value Pr(>|t|)
## (Intercept)                                 0.77762    0.01958  39.723  < 2e-16
## poly(Niraparib, 3)1                        -2.54339    0.17509 -14.526  < 2e-16
## poly(Niraparib, 3)2                        -2.10815    0.17509 -12.040  < 2e-16
## poly(Niraparib, 3)3                        -0.80328    0.17509  -4.588 2.14e-05
## genotypePARP1KO                             0.21659    0.02768   7.823 6.61e-11
## genotypeALC1KO                             -0.22617    0.02768  -8.169 1.62e-11
## genotypeALC1KO PARP1KO                      0.10831    0.02768   3.912 0.000224
## poly(Niraparib, 3)1:genotypePARP1KO         2.37854    0.24762   9.606 5.03e-14
## poly(Niraparib, 3)2:genotypePARP1KO         1.89063    0.24762   7.635 1.42e-10
## poly(Niraparib, 3)3:genotypePARP1KO         0.76369    0.24762   3.084 0.003013
## poly(Niraparib, 3)1:genotypeALC1KO         -0.84916    0.24762  -3.429 0.001064
## poly(Niraparib, 3)2:genotypeALC1KO          1.27394    0.24762   5.145 2.75e-06
## poly(Niraparib, 3)3:genotypeALC1KO          1.27766    0.24762   5.160 2.60e-06
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO  1.41019    0.24762   5.695 3.34e-07
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO  1.39304    0.24762   5.626 4.38e-07
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO  0.69078    0.24762   2.790 0.006943
##                                               
## (Intercept)                                ***
## poly(Niraparib, 3)1                        ***
## poly(Niraparib, 3)2                        ***
## poly(Niraparib, 3)3                        ***
## genotypePARP1KO                            ***
## genotypeALC1KO                             ***
## genotypeALC1KO PARP1KO                     ***
## poly(Niraparib, 3)1:genotypePARP1KO        ***
## poly(Niraparib, 3)2:genotypePARP1KO        ***
## poly(Niraparib, 3)3:genotypePARP1KO        ** 
## poly(Niraparib, 3)1:genotypeALC1KO         ** 
## poly(Niraparib, 3)2:genotypeALC1KO         ***
## poly(Niraparib, 3)3:genotypeALC1KO         ***
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO ***
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO ***
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.08755 on 64 degrees of freedom
## Multiple R-squared:  0.9461, Adjusted R-squared:  0.9335 
## F-statistic: 74.94 on 15 and 64 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit11))
## AIC:  -146.5131
simres <- simulateResiduals(fittedModel = fit11)
plot(simres)

fit12 <- lmer(Counts ~ poly(Niraparib, 3)*genotype + (1|UID), data = dataset)
print(summary(fit12))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Niraparib, 3) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 784.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.54356 -0.39382 -0.04075  0.46432  1.79468 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 16461    128.30  
##  Residual              7512     86.67  
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                            Estimate Std. Error       df t value
## (Intercept)                                  603.40      60.56    16.00   9.963
## poly(Niraparib, 3)1                        -1998.41     173.34    48.00 -11.529
## poly(Niraparib, 3)2                        -1649.24     173.34    48.00  -9.514
## poly(Niraparib, 3)3                         -635.60     173.34    48.00  -3.667
## genotypePARP1KO                              226.15      85.65    16.00   2.640
## genotypeALC1KO                               -93.20      85.65    16.00  -1.088
## genotypeALC1KO PARP1KO                        84.80      85.65    16.00   0.990
## poly(Niraparib, 3)1:genotypePARP1KO         1876.75     245.14    48.00   7.656
## poly(Niraparib, 3)2:genotypePARP1KO         1483.15     245.14    48.00   6.050
## poly(Niraparib, 3)3:genotypePARP1KO          623.91     245.14    48.00   2.545
## poly(Niraparib, 3)1:genotypeALC1KO         -1008.86     245.14    48.00  -4.115
## poly(Niraparib, 3)2:genotypeALC1KO           731.76     245.14    48.00   2.985
## poly(Niraparib, 3)3:genotypeALC1KO          1059.16     245.14    48.00   4.321
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO  1213.51     245.14    48.00   4.950
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO  1167.20     245.14    48.00   4.761
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO   562.54     245.14    48.00   2.295
##                                            Pr(>|t|)    
## (Intercept)                                2.89e-08 ***
## poly(Niraparib, 3)1                        1.97e-15 ***
## poly(Niraparib, 3)2                        1.26e-12 ***
## poly(Niraparib, 3)3                        0.000614 ***
## genotypePARP1KO                            0.017813 *  
## genotypeALC1KO                             0.292640    
## genotypeALC1KO PARP1KO                     0.336865    
## poly(Niraparib, 3)1:genotypePARP1KO        7.32e-10 ***
## poly(Niraparib, 3)2:genotypePARP1KO        2.10e-07 ***
## poly(Niraparib, 3)3:genotypePARP1KO        0.014194 *  
## poly(Niraparib, 3)1:genotypeALC1KO         0.000151 ***
## poly(Niraparib, 3)2:genotypeALC1KO         0.004451 ** 
## poly(Niraparib, 3)3:genotypeALC1KO         7.78e-05 ***
## poly(Niraparib, 3)1:genotypeALC1KO PARP1KO 9.55e-06 ***
## poly(Niraparib, 3)2:genotypeALC1KO PARP1KO 1.81e-05 ***
## poly(Niraparib, 3)3:genotypeALC1KO PARP1KO 0.026164 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit12))
## AIC:  820.5844
simres <- simulateResiduals(fittedModel = fit12)
plot(simres)

Compare Results

ICtab(fit1,fit2,fit3,fit4,
      fit5,fit6,fit7,fit8,
      fit9,fit10,fit11,fit12,
      base=T)
##       AIC    dAIC   df
## fit11 -146.5    0.0 17
## fit7  -124.7   21.8 13
## fit10  -81.6   64.9 17
## fit6   -62.0   84.5 13
## fit3   -44.8  101.7 9 
## fit2     8.2  154.7 9 
## fit12  820.6  967.1 18
## fit8   878.8 1025.3 14
## fit4   999.1 1145.6 10
## fit9  1029.5 1176.0 21
## fit5  1031.8 1178.3 17
## fit1  1070.0 1216.5 13

Final Result

fit <- fit11

output <- coef(summary(fit))
output <- output[grep("Niraparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Niraparib1 in WT -2.5433912 0.1750950 -14.525780 0.0000000
Niraparib2 in WT -2.1081472 0.1750950 -12.040020 0.0000000
Niraparib3 in WT -0.8032833 0.1750950 -4.587700 0.0000214
Niraparib1: WT vs. PARP1KO 2.3785388 0.2476217 9.605534 0.0000000
Niraparib2: WT vs. PARP1KO 1.8906339 0.2476217 7.635170 0.0000000
Niraparib3: WT vs. PARP1KO 0.7636918 0.2476217 3.084107 0.0030127
Niraparib1: WT vs. ALC1KO -0.8491589 0.2476217 -3.429259 0.0010638
Niraparib2: WT vs. ALC1KO 1.2739376 0.2476217 5.144693 0.0000027
Niraparib3: WT vs. ALC1KO 1.2776559 0.2476217 5.159709 0.0000026
Niraparib1: WT vs. ALC1KO PARP1KO 1.4101940 0.2476217 5.694953 0.0000003
Niraparib2: WT vs. ALC1KO PARP1KO 1.3930368 0.2476217 5.625665 0.0000004
Niraparib3: WT vs. ALC1KO PARP1KO 0.6907757 0.2476217 2.789641 0.0069435
write.table(output, file = "FigureS1G_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")
        
fit <- lm(NormCounts2 ~ poly(Niraparib,3)*genotype, data = dataset)


output <- coef(summary(fit))
output <- output[grep("Niraparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Niraparib1 in ALC1KO -3.3925501 0.1750950 -19.3754836 0.0000000
Niraparib2 in ALC1KO -0.8342096 0.1750950 -4.7643259 0.0000113
Niraparib3 in ALC1KO 0.4743727 0.1750950 2.7092304 0.0086432
Niraparib1: ALC1KO vs. WT 0.8491589 0.2476217 3.4292586 0.0010638
Niraparib2: ALC1KO vs. WT -1.2739376 0.2476217 -5.1446928 0.0000027
Niraparib3: ALC1KO vs. WT -1.2776559 0.2476217 -5.1597089 0.0000026
Niraparib1: ALC1KO vs. PARP1KO 3.2276977 0.2476217 13.0347928 0.0000000
Niraparib2: ALC1KO vs. PARP1KO 0.6166963 0.2476217 2.4904776 0.0153633
Niraparib3: ALC1KO vs. PARP1KO -0.5139641 0.2476217 -2.0756021 0.0419542
Niraparib1: ALC1KO vs. ALC1KO PARP1KO 2.2593529 0.2476217 9.1242119 0.0000000
Niraparib2: ALC1KO vs. ALC1KO PARP1KO 0.1190992 0.2476217 0.4809723 0.6321764
Niraparib3: ALC1KO vs. ALC1KO PARP1KO -0.5868803 0.2476217 -2.3700679 0.0208099
write.table(output, file = "FigureS1G_Stats_Ref_ALC1KO.txt", quote = F, sep = "\t", row.names = T, col.names = NA)

Anova

fita <- lm(NormCounts2 ~ poly(Niraparib, 3)*genotype, data = dataset)
fitb <- lm(NormCounts2 ~ poly(Niraparib, 3)+genotype, data = dataset)

# anova table
anova(fita, fitb)
## Analysis of Variance Table
## 
## Model 1: NormCounts2 ~ poly(Niraparib, 3) * genotype
## Model 2: NormCounts2 ~ poly(Niraparib, 3) + genotype
##   Res.Df     RSS Df Sum of Sq     F    Pr(>F)    
## 1     64 0.49053                                 
## 2     73 2.73518 -9   -2.2447 32.54 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1